package com.flying.invest.strategy.service;

import com.flying.common.annotation.DaoCreate;
import com.flying.common.annotation.DaoQuery;
import com.flying.common.annotation.DaoRemove;
import com.flying.common.annotation.DaoUpdate;
import com.flying.common.util.Codes;
import com.flying.framework.annotation.MethodInfo;
import com.flying.framework.annotation.Param;
import com.flying.framework.annotation.Service;
import com.flying.framework.model.ActionResult;
import com.flying.framework.model.QueryResult;
import com.flying.framework.service.AbstractService;
import com.flying.invest.strategy.model.Strategy;
import com.flying.invest.strategy.model.StrategyType;

@Service(value="StrategyTypeService", desc="")
public class StrategyTypeService extends AbstractService{
        
	@MethodInfo("新增")
	@DaoCreate(entity=StrategyType.ENTITY_NAME)
	public StrategyType create(
		
			@Param(value=StrategyType.NAME, required=true,	desc="名称") String name,
			@Param(value=StrategyType.CODE, required=false,	desc="代码") String code,
			@Param(value=StrategyType.ICON, required=false,	desc="图标") String icon,
			@Param(value=StrategyType.TERM_TYPE, required=false,	desc="投资周期") Integer term_type,
			@Param(value=StrategyType.REMARKS, required=false,	desc="说明") String remarks,
			@Param(value=StrategyType.SERVICE, required=false,	desc="服务") String service
		
		) throws Exception {
		
		return null;
	}

	@MethodInfo("修改")
	@DaoUpdate(entity=StrategyType.ENTITY_NAME)
	public ActionResult update(
		
			@Param(value=StrategyType.TYPE_ID, required=true,	desc="ID") Long type_id,
			@Param(value=StrategyType.NAME, required=true,	desc="名称") String name,
			@Param(value=StrategyType.CODE, required=false,	desc="代码") String code,
			@Param(value=StrategyType.ICON, required=false,	desc="图标") String icon,
			@Param(value=StrategyType.TERM_TYPE, required=false,	desc="投资周期") Integer term_type,
			@Param(value=StrategyType.REMARKS, required=false,	desc="说明") String remarks,
			@Param(value=StrategyType.SERVICE, required=false,	desc="服务") String service
			
		) throws Exception {
		
		return null;
	}

	@MethodInfo("删除")
	@DaoRemove(entity=StrategyType.ENTITY_NAME)
	public ActionResult remove(
			@Param(value=StrategyType.TYPE_ID, required=true,	desc="ID") Long type_id
		) throws Exception {
		
		return null;
	}

	@MethodInfo("搜索")
	@DaoQuery(entity=StrategyType.ENTITY_NAME, pageable=true, modelClass=StrategyType.class)
	public QueryResult<StrategyType> findAll(
			@Param(value=Codes.PAGE_NUM, 	required=false, desc="分页页号，默认0") int page,
			@Param(value=Codes.PAGE_SIZE, 	required=false, desc="分页大小，默认10") int rows) throws Exception {
		return null;
	}

	@MethodInfo("查询")
	@DaoQuery(entity=StrategyType.ENTITY_NAME, single=true, throwsNotFoundException=true )
	public StrategyType findById(
			@Param(value=StrategyType.TYPE_ID, required=true,	desc="ID") Long type_id
		) throws Exception {
		return null;
	}

	@MethodInfo("查询")
	@DaoQuery(entity=StrategyType.ENTITY_NAME, single=true, throwsNotFoundException=true )
	public StrategyType findByStrategyId(
			@Param(value=Strategy.STRATEGY_ID, required=true,	desc="策略ID") Long strategy_id
		) throws Exception {
		return null;
	}

}